Update Method (Message Object) 

The Update method saves the message in the MAPI system.

Syntax

objMessage.Update( [makePermanent, refreshObject] )

Parameters

objMessage

Required. The Message object.

makePermanent

Optional. Boolean. TRUE indicates that the property cache is flushed and all changes are committed to the underlying message store. FALSE indicates that the property cache is flushed and not committed to the message store. The default value is TRUE.

refreshObject

Optional. Boolean. TRUE indicates that the property cache is reloaded from the values in the underlying message store. FALSE indicates that the property cache is not reloaded. The default value is FALSE.

 

Remarks

Changes to Message objects are not permanently saved in the MAPI system until you call the Update method with the makePermanent parameter set to TRUE.

For improved performance, the OLE Messaging Library caches property changes in private storage and updates either the object or the underlying message store only when you explicitly request such an update. For efficiency, you should make only one call to Update with its makePermanent parameter set to TRUE.

The makePermanent and refreshObject parameters combine to cause the following changes:

 

refreshObject = TRUE

refreshObject = FALSE

makePermanent = TRUE

Commit all changes, flush the cache, and reload the cache from the message store.

Commit all changes and flush the cache.

makePermanent = FALSE

Flush the cache and reload the cache from the message store.

Flush the cache.

 

Call Update(FALSE, TRUE) to flush the cache and then reload the values from the message store.

Example

This example changes the subject of the first message in a folder:

Set objMessage = objSession.Inbox.GetFirst

' ... verify message

objMessage.Subject = "This is the new subject"

objMessage.Update

 

To add a new Message object, use the Add method followed by the Update method. This example saves a new message:

Dim objMessage As Object   ' message object

' ...

Set objMessage = objSession.Outbox.Messages.Add

objMessage.Subject = "Microsoft Bob(TM)"

objMessage.Text = "This is incredible, you've got to see it!"

objMessage.Update makePermanent:=True

 

See Also

Send Method (Message Object)1JTD0I1